import fetch from '@/config/fetch'

/*
 *登陆
 */

export const login = data => fetch('/login', data, 'POST')

/*
 *用户信息
 */

export const loginInfo = () => fetch('/users/remark/info/self')

/*
 *首页数据
 */

export const fetchHomeChart = () => fetch('/report/index')

/**
 * 获取用户列表
 */

export const searchUser = data => fetch('/users/find', data);

/**
 * 用户列表搜索
 */

export const getUserList = data => fetch('/users/list', data);


/**
 * 退出
 */

export const signout = () => fetch('/logOut');

/**
 * 获取用户信息
 */

export const getAdminInfo = () => fetch('/users/remark/info/self');

/**
 * 获取异常数据
 */

export const getUnusualInfo = data => fetch('/customerService/abnormalList', data);

/**
 * 返回一个生理周期的激素值列表
 */

export const physiologicals = data => fetch('/users/physiologicals/list', data);

/**
 * 获取所有例假开始周期
 */

export const allPeriod = data => fetch('/users/' + data.userId + '/menstruation/info');

/**
 * 获取排卵日期
 */

export const ovuPeriod = data => fetch('/users/record/ovuPeriod', data);

/**
 * 获取指定周期图表渲染参数
 */

export const advancedQuery = data => fetch('/users/physiologicals/advancedQuery/list', data);

/**
 * 添加VIP参数
 */

export const vipDataQuery = data => fetch('/users/peak/addVip2/query', data);

/**
 * 是否加入千人计划
 */

export const thousandPlanStatus = data => fetch('/customerService/thousandPlanStatus/update', data, "POST");

/**
 * 客服是否操作
 */

export const customerStatus = data => fetch('/customerService/customerStatus/update', data, "POST");


/**
 * 异常数据搜索
 */

export const customerFind = data => fetch('/customerService/abnormalSearch', data);


/**
 * 修改密码
 */

export const changePwd = data => fetch('/users/sysUser/password/update', data);

/**
 * 获取短信模板
 */

export const fetchGetSMSTemplate = data => fetch('/templateManager/findAllMessageTemplate', data);

/**
 * 发送短信的详情
 */

export const fetchSendMessageView = data => fetch('/informationPush/alidayuMessage/findDetail', data);

/**
 * 发送短信
 */

export const fetchSendSMS = data => fetch('/informationPush/sendMessage', data, "POST");

/**
 * 新建短信模板
 */

export const fetchNewSMSTemplate = data => fetch('/templateManager/saveMessageTemplate', data, "POST");

/**
 * 搜索短信模板
 */

export const fetchSearchSMSTemplate = data => fetch('/templateManager/searchMessageTemplates', data);

/**
 * 删除短信模板
 */

export const fetchDeleteSMSTemplate = data => fetch('/templateManager/deleteMessageTemplates', data, "POST");

/**
 * 查询帮助反馈
 */
export const fetchGetFeedbackData = data => fetch('/customerService/feedBack/findAll', data);

/**
 * 搜索帮助反馈
 */

export const fetchSearchFeedbackData = data => fetch('/customerService/feedBack/findAll', data);

/**
 * 历史帮助反馈
 */

export const fetchHistoryFeedbackData = data => fetch('/customerService/feedBack/findHistory', data);

/**
 * 回复帮助反馈
 */

export const fetchReplyFeedbackData = data => fetch('/customerService/feedBackReply/save', data, 'POST');

/**
 * 短信发送记录
 */

export const fetchAlidayuMessageSendData = data => fetch('/informationPush/alidayuMessageSend/findAll', data);

/**
 * 友盟消息模板
 */

export const fetchYouMengTemplateData = data => fetch('/templateManager/findAllPushTemplate', data);

/**
 * 友盟新建消息模板
 */

export const fetchNewYouMengTemplateData = data => fetch('/templateManager/savePushTemplate', data, "POST");

/**
 * 友盟删除消息模板
 */

export const fetchDeleteYouMengTemplateData = data => fetch('/templateManager/deletePushTemplate', data, "POST");

/**
 * 友盟搜索消息模板
 */

export const fetchSearchYouMengTemplateData = data => fetch('/templateManager/searchPushTemplate', data);

/**
 * 友盟推送记录
 */

export const fetchYouMengViewData = data => fetch('/informationPush/youmengPush/findDetail', data);

/**
 * 友盟推送记录
 */

export const fetchYouMengPushHistoryData = data => fetch('/informationPush/youMengPush/findAll', data);

/**
 * 发送友盟推送
 */

export const fetchYouMengPushData = data => fetch('/informationPush/youmengPush', data, "POST");

/**
 * 推送类型
 */

export const fetchMessageTypeData = data => fetch('/templateManager/findAllMessageType', data);

/**
 * 站内APP推送记录
 */

export const fetchAppMessagePushHistoryData = data => fetch('/informationPush/AppMessagePush/findAll', data);

/**
 * 发送站内APP推送
 */

export const fetchAppMessagePushData = data => fetch('/informationPush/AppMessagePush', data, 'POST');

/**
 * 站内APP发送推送详情
 */

export const fetchAppMessageViewData = data => fetch('/informationPush/AppMessagePush/findDetail', data);

/**
 * 设备列表
 */

export const fetchGetEquipmentManageData = data => fetch('/equipmentManage/list', data);

/**
 * 搜索设备
 */

export const fetchSearchEquipmentManageData = data => fetch('/equipmentManage/equipment/search', data);

/**
 * 解除设备
 */

export const fetchEquipmentUnbindData = data => fetch('/equipmentManage/equipment/unbind', data, 'POST');

/**
 * 设备绑定历史
 */

export const fetchGetEquipmentHistoryData = data => fetch('/equipmentManage/equipment/findHistory', data);

/**
 * 设备根据绑定时间次数排序
 */

export const fetchGetEquipmentSortData = data => fetch('/equipmentManage/equipment/sort', data);

/**
 * 上传阴超图片
 */

export const fetchUploadImg = data => fetch('/users/ultrasound/upload', data, 'POST');

/**
 * 获取阴超图片
 */

export const fetchDownloadImg = data => fetch('/users/record/ultrasound', data);
